import { pa } from 'element-plus/es/locale';
import request from '/@/utils/request';


export function getList(params:object) {
	return request({
		url: '/Chapter/index',
		method: 'get',
		params
	});
}

export function save(params:object){
    return request({
        url:'/Chapter/save',
        method:'post',
        data:params
    })
}
// 新增科目
export function subjectCreate(params:object){
    return request({
        url:'/index/subjectCreate',
        method:'post',
        data:params
    })
}

//删除科目
export function subjectDel(params:object){
    return request({
        url:'/index/subjectDel',
        method:'post',
        data:params
    })
}

// 更新科目
export function subjectUpdate(params:object) {
    return request({
        url:'/index/subjectUpdate',
        method:'put',
        data:params
    })
}
// 获取章节
export function getChaptersBySubject(subjectId:any){
    return request({
        url:'/Chapter/getChaptersBySubject',
        method:'post',
        data:subjectId
    })
}
export function del(id:any){
    return request({
        url:'/Chapter/delete',
        method:'post',
        data:id
    })
}
export function update(params:object){
    return request({
        url:'/Chapter/update',
        method:'post',
        data:params
    })
}

export function getListsss (params:object){
    return request({
        url:'/Chapter/getList',
        method:'post',
        data:params
    })
}

// 获取科目列表
export function getSubjects() {
return request({
    url: '/index/subject',
    method: 'get',
});
}